var login = new Validated();
login.rules = {
    "corpname": {
        "data": /^[\u4e00-\u9fa5]{2,}|[a-z]{2,}|[0-9]{2,}$/,
        "complete": "ok",
        "error": "至少为两个汉字、英文字符或数字",
        "normal": "请用汉字、英文字符或数字",
        "required": true
    },
    "linkname": {
        "data": /^[\u4e00-\u9fa5]{2,}|[a-z]{2,}|[0-9]{2,}$/,
        "complete": "ok",
        "error": "至少为两个汉字、英文字符或数字字",
        "normal": "请用汉字、英文字符或数字",
        "required": true
    },
    "phone": {
        "data": /^0?1[1-9]\d{9}$/,
        "complete": "ok",
        "error": "请检查电话号码是否正确",
        "normal": "请输入手机号码",
        "required": true
    },
}
login.blur().focus();
$("input").blur(function(){
    if (login.complete("corpname", "linkname", "phone")){
        $('.applybutn').addClass('blue');
    }
})
$(".applybutn").click(function ()
{
    if (Cookie.Get("account") == "" || Cookie.Get("account") == null) {
       tanchuan("请登陆", "3", "/login/login", "1");
    } else {
        if (login.complete("corpname", "linkname", "phone"))
        {
            $('.applybutn').addClass('blue');
            new Ajax('/source/details_back.jsp').keyvalue($('#source').serializeArray()).get(function (json) {
                if (json == 1) {
                    tanchuan("报名成功", "1", "/source/list", "1");
                } else {
                    tanchuan("已报名，请勿重复报名", "0", "/source/list", "1");
                }
            })
        } else {
            tanchuan("请确认信息是否填完整", "0", "", "0");
        }
    }
});
window.onload = function () {
    $.each($(".details_content1 h3 span"), function () {
        if ($(this).text() == "2057-10-01") {
            $(this).text("长期有效");
        }
    })
}

